<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/order/View_OrderInfo.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/order/View_OrderInfo.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Order_Id',
                footer: "Foots",
                cnName: '订单详情',
                name: 'order/View_OrderInfo',
                url: "/View_OrderInfo/",
                sortName: "OrderDate"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"OrderNo":"","OrderType":"","TotalQty":[null,null],"TotalPrice":[null,null],"GoodsCode":"","GoodsName":"","Specs":"","Price":[null,null],"Qty":[null,null],"OrderDate":"","Creator":""});
            const searchFormOptions = ref([[{"title":"订单编号","field":"OrderNo","type":"like"},{"dataKey":"订单状态","data":[],"title":"订单类型","field":"OrderType","type":"select"},{"title":"订单数量","field":"TotalQty","type":"range"},{"title":"订单金额","field":"TotalPrice","type":"range"}],[{"title":"商品编号","field":"GoodsCode","type":"like"},{"title":"商品名称","field":"GoodsName","type":"like"},{"dataKey":"商品规格","data":[],"title":"商品规格","field":"Specs","type":"select"},{"title":"单价","field":"Price","type":"range"}],[{"title":"数量","field":"Qty","type":"range"},{"title":"订单日期","field":"OrderDate","type":"datetime"},{"title":"创建人","field":"Creator","type":"like"}]]);
            const columns = ref([{field:'OrderNo',title:'订单编号',type:'string',sort:true,width:120,require:true,align:'left',sort:true},
                       {field:'OrderType',title:'订单类型',type:'int',bind:{ key:'订单状态',data:[]},width:90,require:true,align:'left'},
                       {field:'TotalQty',title:'订单数量',type:'int',sort:true,width:80,align:'left'},
                       {field:'TotalPrice',title:'订单金额',type:'decimal',sort:true,width:80,align:'left'},
                       {field:'GoodsId',title:'GoodsId',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'GoodsCode',title:'商品编号',type:'string',sort:true,width:100,hidden:true,align:'left'},
                       {field:'GoodsName',title:'商品名称',type:'string',sort:true,width:100,align:'left'},
                       {field:'Specs',title:'商品规格',type:'string',bind:{ key:'商品规格',data:[]},sort:true,width:100,align:'left'},
                       {field:'Price',title:'单价',type:'decimal',sort:true,width:80,align:'left'},
                       {field:'Qty',title:'数量',type:'int',sort:true,width:80,align:'left'},
                       {field:'Img',title:'商品图片',type:'img',width:90,align:'left'},
                       {field:'OrderDate',title:'订单日期',type:'datetime',width:110,require:true,align:'left',sort:true},
                       {field:'Creator',title:'创建人',type:'string',width:130,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
